<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Class address_mac</title>
<link rel="stylesheet" href="../../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="../../../index.html" title="ODTONE 0.4">
<link rel="up" href="../../../odtone_net_library.html#header..home.carlos.Projectos.odtone.inc.odtone.net.link.address_mac_hpp" title="Header &lt;/home/carlos/Projectos/odtone/inc/odtone/net/link/address_mac.hpp&gt;">
<link rel="prev" href="../ip/prefix_v6.html" title="Class prefix_v6">
<link rel="next" href="../../changelog.html" title="Changelog">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="'ODTONE - Open Dot Twenty One'" width="100" height="100" src="../../.././images/logo.png"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../ip/prefix_v6.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../odtone_net_library.html#header..home.carlos.Projectos.odtone.inc.odtone.net.link.address_mac_hpp"><img src="../../../images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../images/home.png" alt="Home"></a><a accesskey="n" href="../../changelog.html"><img src="../../../images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="odtone.net.link.address_mac"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class address_mac</span></h2>
<p>odtone::net::link::address_mac</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../odtone_net_library.html#header..home.carlos.Projectos.odtone.inc.odtone.net.link.address_mac_hpp" title="Header &lt;/home/carlos/Projectos/odtone/inc/odtone/net/link/address_mac.hpp&gt;">/home/carlos/Projectos/odtone/inc/odtone/net/link/address_mac.hpp</a>&gt;

</span>
<span class="keyword">class</span> <a class="link" href="address_mac.html" title="Class address_mac">address_mac</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">array</span><span class="special">&lt;</span> <span class="identifier">uint8</span><span class="special">,</span> <span class="number">6</span> <span class="special">&gt;</span> <a name="odtone.net.link.address_mac.bytes_type"></a><span class="identifier">bytes_type</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="address_mac.html#odtone.net.link.address_macconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="address_mac.html#idp4752440-bb"><span class="identifier">address_mac</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">explicit</span> <a class="link" href="address_mac.html#idp4752736-bb"><span class="identifier">address_mac</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">uint8</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">explicit</span> <a class="link" href="address_mac.html#idp4753808-bb"><span class="identifier">address_mac</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bytes_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="address_mac.html#idp5081832-bb">public static functions</a></span>
  <span class="keyword">static</span> <a class="link" href="address_mac.html" title="Class address_mac">address_mac</a> <a class="link" href="address_mac.html#idp5082016-bb"><span class="identifier">from_string</span></a><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">static</span> <a class="link" href="address_mac.html" title="Class address_mac">address_mac</a> <a class="link" href="address_mac.html#idp5083776-bb"><span class="identifier">from_string</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="address_mac.html#idp5085536-bb">public member functions</a></span>
  <span class="keyword">bool</span> <a class="link" href="address_mac.html#idp5085720-bb"><span class="keyword">operator</span><span class="special">&lt;</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="address_mac.html" title="Class address_mac">address_mac</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <a class="link" href="address_mac.html#idp4750288-bb"><span class="identifier">to_string</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">bytes_type</span> <a class="link" href="address_mac.html#idp4751392-bb"><span class="identifier">to_bytes</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="address_mac.html#idp4754888-bb">friend functions</a></span>
  <span class="keyword">friend</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> <a class="link" href="address_mac.html#idp4755096-bb"><span class="keyword">operator</span><span class="special">&lt;&lt;</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="address_mac.html" title="Class address_mac">address_mac</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="address_mac.html#odtone.net.link.address_macpublic-data-members">public data members</a></span>
  <span class="identifier">bytes_type</span> <a class="link" href="address_mac.html#odtone.net.link.address_mac._address"><span class="identifier">_address</span></a><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idp21163696"></a><h2>Description</h2>
<p>This class represents the MAC address. </p>
<div class="refsect2">
<a name="idp21164032"></a><h3>
<a name="odtone.net.link.address_macconstruct-copy-destruct"></a><code class="computeroutput">address_mac</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="idp4752440-bb"></a><span class="identifier">address_mac</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Construct an empty MAC address. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">explicit</span> <a name="idp4752736-bb"></a><span class="identifier">address_mac</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">uint8</span> address<span class="special">)</span><span class="special">;</span></pre>
<p>Construct a MAC address.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">address</code></span></p></td>
<td><p>The MAC address raw bytes. </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">explicit</span> <a name="idp4753808-bb"></a><span class="identifier">address_mac</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">bytes_type</span> <span class="special">&amp;</span> address<span class="special">)</span><span class="special">;</span></pre>
<p>Construct a MAC address.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">address</code></span></p></td>
<td><p>The MAC address raw bytes. </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idp21177056"></a><h3>
<a name="idp5081832-bb"></a><code class="computeroutput">address_mac</code> public static functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <a class="link" href="address_mac.html" title="Class address_mac">address_mac</a> <a name="idp5082016-bb"></a><span class="identifier">from_string</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> str<span class="special">)</span><span class="special">;</span></pre>
<p>Get the MAC address from a string.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">str</code></span></p></td>
<td><p>The input string. </p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>The extracted MAC address. </p></td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <a class="link" href="address_mac.html" title="Class address_mac">address_mac</a> <a name="idp5083776-bb"></a><span class="identifier">from_string</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span> str<span class="special">)</span><span class="special">;</span></pre>
<p>Get the MAC address from a string.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">str</code></span></p></td>
<td><p>The input string. </p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>The extracted MAC address. </p></td>
</tr>
</tbody>
</table></div>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idp21190456"></a><h3>
<a name="idp5085536-bb"></a><code class="computeroutput">address_mac</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="idp5085720-bb"></a><span class="keyword">operator</span><span class="special">&lt;</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="address_mac.html" title="Class address_mac">address_mac</a> <span class="special">&amp;</span> lhs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Check if the MAC address is smaller than another MAC address.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">lhs</code></span></p></td>
<td><p>The MAC address to compare with. </p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>True if they are equal or false otherwise. </p></td>
</tr>
</tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <a name="idp4750288-bb"></a><span class="identifier">to_string</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Convert the MAC address to a string.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>A string representation of this object. </p></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">bytes_type</span> <a name="idp4751392-bb"></a><span class="identifier">to_bytes</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Get the MAC address raw bytes.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>The MAC address raw bytes. </p></td>
</tr></tbody>
</table></div>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idp21205504"></a><h3>
<a name="idp4754888-bb"></a><code class="computeroutput">address_mac</code> friend functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">friend</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> <a name="idp4755096-bb"></a><span class="keyword">operator</span><span class="special">&lt;&lt;</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">&amp;</span> out<span class="special">,</span> <span class="keyword">const</span> <a class="link" href="address_mac.html" title="Class address_mac">address_mac</a> <span class="special">&amp;</span> mac<span class="special">)</span><span class="special">;</span></pre>
<p>MAC address output.</p>
<p>

</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">mac</code></span></p></td>
<td><p>The IPv6 Prefix. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">out</code></span></p></td>
<td><p>ostream. </p></td>
</tr>
</tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>ostream reference. </p></td>
</tr>
</tbody>
</table></div>
</li></ol></div>
</div>
<div class="refsect2">
<a name="idp21215824"></a><h3>
<a name="odtone.net.link.address_macpublic-data-members"></a><code class="computeroutput">address_mac</code> 
        public
       public data members</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="identifier">bytes_type</span> <a name="odtone.net.link.address_mac._address"></a><span class="identifier">_address</span><span class="special">;</span></pre>
<p>The MAC address raw bytes. </p>
</li></ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2012 Universidade
      Aveiro<br>Copyright &#169; 2009-2012 Instituto
      de Telecomunica&#231;&#245;es - P&#243;lo Aveiro<p>
        This software is distributed under a license. The full license agreement
        can be found in the LICENSE in this distribution. This software may not be
        copied, modified, sold or distributed other than expressed in the named license
        agreement. This software is distributed without any warranty.
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../ip/prefix_v6.html"><img src="../../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../odtone_net_library.html#header..home.carlos.Projectos.odtone.inc.odtone.net.link.address_mac_hpp"><img src="../../../images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../images/home.png" alt="Home"></a><a accesskey="n" href="../../changelog.html"><img src="../../../images/next.png" alt="Next"></a>
</div>
</body>
</html>
